package com.wiloon.java8x.thread.callable;

import java.util.concurrent.Callable;

/*
 * Created by roy on 6/27/17;
 */
public class Task implements Callable<Integer> {
    @Override
    public Integer call() throws Exception {
        System.out.println("子线程在进行计算");
        Thread.sleep(3000);
        int sum = 0;
        for (int i = 0; i < 100; i++)
            sum += i;

        System.out.println("sum:" + sum);
        return sum;
    }
}